﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using HtmlAgilityPack;
using System.Xml.Linq;

namespace AirSystem
{
    public class AirHelper
    {

        public static ResponseDTO GetResponse(RequestDTO requestDTO)
        {
            ResponseDTO responseDTO = new ResponseDTO();
            
            responseDTO.Origin = requestDTO.Origin;
            responseDTO.Destination = requestDTO.Destination;
            responseDTO.StartDate = requestDTO.StartDate;
            responseDTO.EndDate = requestDTO.EndDate;
            responseDTO.RoundTrip = requestDTO.RoundTrip;

            string roundTrip = "OneWay";
            if (responseDTO.RoundTrip == true)
            {
                roundTrip = "RoundTrip";
            }

            //HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://booking.airmekong.com.vn/SearchInfo.aspx");

            //request.Method = "POST";

            string data = string.Format("__EVENTTARGET="+
"&__EVENTARGUMENT="+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$RadioButtonMarketStructure={6}"+
"&originStation1={0}"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$TextBoxMarketOrigin1={0}"+
"&destinationStation1={1}"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$TextBoxMarketDestination1={1}"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListMarketDay1={2}"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListMarketMonth1={3}"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListMarketDateRange1=0|4"+
"&originStation2="+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$TextBoxMarketOrigin2=Điểm đi..."+
"&destinationStation2="+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$TextBoxMarketDestination2=Điểm đến..."+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListMarketDay2={4}"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListMarketMonth2={5}"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListMarketDateRange2=0|4"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListPassengerType_ADT=1"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListPassengerType_CHD=0"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListPassengerType_INFANT=0"+
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$DropDownListSearchBy=columnView" +
"&ControlGroupSearchInfoView$AvailabilitySearchInputSearchInfoView$ButtonSubmit=Tìm chuyến bay", 
responseDTO.Origin, 
responseDTO.Destination,
responseDTO.StartDate.Day.ToString(),
responseDTO.StartDate.Year.ToString() + "-" + responseDTO.StartDate.Month.ToString(),
responseDTO.EndDate.Day.ToString(),
responseDTO.EndDate.Year.ToString() + "-" + responseDTO.EndDate.Month.ToString(),
roundTrip);

           

            MeKongAirWebClient MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/SearchInfo.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            string text = MeKongClient.LoadPage(data);

            
            
            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(text);
            
           

            

                if (doc.DocumentNode != null)
                {
                    List<HtmlNode> TableOrigin = (from node in doc.DocumentNode.SelectNodes("//table[@id]").Cast<HtmlNode>()
                                               where ((node.Attributes["id"].Value == "availabilityTable0"))
                                               select node).ToList<HtmlNode>();

                    if (TableOrigin.Count>0 && TableOrigin[0] != null)
                    {
                        string XPath2 = TableOrigin[0].XPath + "/tr[3]/td[@colspan]";
                        HtmlNode notFound = TableOrigin[0].SelectSingleNode(XPath2);

                        if (notFound != null)
                        {

                        }
                        else
                        {
                            //Tim thay chuyen bay
                            List<HtmlNode> fightNodeRows = (from node in TableOrigin[0].SelectNodes(TableOrigin[0].XPath + "/tr").Cast<HtmlNode>()
                                                            select node).ToList<HtmlNode>();
                            fightNodeRows.RemoveRange(0, 2);
                            foreach (HtmlNode item in fightNodeRows)
                            {
                                List<HtmlNode> fightInfoCell = (from node in TableOrigin[0].SelectNodes(item.XPath + "/td").Cast<HtmlNode>()
                                                                select node).ToList<HtmlNode>();
                                FightDTO tempFight = new FightDTO();
                                string preStr = StandardlizeEx(fightInfoCell[0].InnerText);
                                tempFight.ID = preStr;
                                preStr = Standardlize(fightInfoCell[1].InnerText);
                                tempFight.DepartsTime = preStr;
                                preStr = Standardlize(fightInfoCell[2].InnerText);
                                tempFight.ArrivesTime = preStr;
                                Ticket tk1 = new Ticket { Kind = "Full Deluxe", Price = Standardlize(fightInfoCell[3].InnerText) };
                                setTicketID(ref tk1, fightInfoCell[3]);
                                Ticket tk2 = new Ticket { Kind = "Deluxe Saver", Price = Standardlize(fightInfoCell[4].InnerText) };
                                setTicketID(ref tk2, fightInfoCell[4]);
                                Ticket tk3 = new Ticket { Kind = "Super Flex", Price = Standardlize(fightInfoCell[5].InnerText) };
                                setTicketID(ref tk3, fightInfoCell[5]);
                                Ticket tk4 = new Ticket { Kind = "Eco Flex", Price = Standardlize(fightInfoCell[6].InnerText) };
                                setTicketID(ref tk4, fightInfoCell[6]);
                                Ticket tk5 = new Ticket { Kind = "Promo.(*E)", Price = Standardlize(fightInfoCell[7].InnerText) };
                                setTicketID(ref tk5, fightInfoCell[7]);
                                tempFight.Tickets.Add(tk1);
                                tempFight.Tickets.Add(tk2);
                                tempFight.Tickets.Add(tk3);
                                tempFight.Tickets.Add(tk4);
                                tempFight.Tickets.Add(tk5);
                                tempFight.setMinTicket();
                                responseDTO.GoingOut.Add(tempFight);
                            }
                        }

                    }


                    List<HtmlNode> TableDes = (from node in doc.DocumentNode.SelectNodes("//table[@id]").Cast<HtmlNode>()
                                               where ((node.Attributes["id"].Value == "availabilityTable1"))
                                                  select node).ToList<HtmlNode>();

                    if (TableDes.Count>0 && TableDes[0] != null)
                    {
                        string XPath2 = TableDes[0].XPath + "/tr[3]/td[@colspan]";
                        HtmlNode notFound = TableDes[0].SelectSingleNode(XPath2);

                        if (notFound !=null)
                        {
                            
                        }
                        else
                        {
                            //Tim thay chuyen bay
                            List<HtmlNode> fightNodeRows = (from node in TableDes[0].SelectNodes(TableDes[0].XPath + "/tr").Cast<HtmlNode>()
                                                            select node).ToList<HtmlNode>();
                            fightNodeRows.RemoveRange(0, 2);
                            foreach (HtmlNode item in fightNodeRows)
                            {
                                List<HtmlNode> fightInfoCell = (from node in TableDes[0].SelectNodes(item.XPath+"/td").Cast<HtmlNode>()
                                                                select node).ToList<HtmlNode>();
                                FightDTO tempFight = new FightDTO();
                                tempFight.ID = StandardlizeEx(fightInfoCell[0].InnerText);
                                tempFight.DepartsTime = Standardlize(fightInfoCell[1].InnerText);
                                tempFight.ArrivesTime = Standardlize(fightInfoCell[2].InnerText);
                                Ticket tk1 = new Ticket { Kind = "Full Deluxe", Price = Standardlize(fightInfoCell[3].InnerText) };
                                setTicketID(ref tk1, fightInfoCell[3]);
                                Ticket tk2 = new Ticket { Kind = "Deluxe Saver", Price = Standardlize(fightInfoCell[4].InnerText) };
                                setTicketID(ref tk2, fightInfoCell[4]);
                                Ticket tk3 = new Ticket { Kind = "Super Flex", Price = Standardlize(fightInfoCell[5].InnerText) };
                                setTicketID(ref tk3, fightInfoCell[5]);
                                Ticket tk4 = new Ticket { Kind = "Eco Flex", Price = Standardlize(fightInfoCell[6].InnerText) };
                                setTicketID(ref tk4, fightInfoCell[6]);
                                Ticket tk5 = new Ticket { Kind = "Promo.(*E)", Price = Standardlize(fightInfoCell[7].InnerText) };
                                setTicketID(ref tk5, fightInfoCell[7]);
                                tempFight.Tickets.Add(tk1);
                                tempFight.Tickets.Add(tk2);
                                tempFight.Tickets.Add(tk3);
                                tempFight.Tickets.Add(tk4);
                                tempFight.Tickets.Add(tk5);
                                tempFight.setMinTicket();
                                responseDTO.ComingBack.Add(tempFight);
                            }
                        }

                    }
                }
            
            

            return responseDTO;
        }

        
        private static void setTicketID(ref Ticket tk, HtmlNode htmlNode)
        {
            if (tk.Price.IndexOf('H') < 0)
            {
                
                tk.TicketID = Standardlize(htmlNode.SelectSingleNode(htmlNode.XPath + "/p/input").Attributes["value"].Value);
            }
        }
        public static string Standardlize(string str)
        {
            str = str.Replace("\n", "");
            str = str.Replace("\r", "");
            //str = str.Replace(" ", "");
            str = str.Trim();
            
            return str;
        }

        public static string StandardlizeEx(string str)
        {
            str = str.Replace("\n", "");
            str = str.Replace("\r", "");
            str = str.Replace(" ", "");
            str = str.Trim();

            return str;
        }


        public static BookingResponseDTO BookingOnline(Ticket GoingOut, Ticket ComingBack, ResponseDTO ResponseInfo, BookingDTO BookingInfo)
        {
            BookingResponseDTO BookingResult = new BookingResponseDTO(BookingInfo);
            
            if (ComingBack == null)
            {
                //OneWay
            }
            else
            {
                //RoundTrip
                //RoundTripBooking();
            }

            return BookingResult;
        }

        public static void OneWAyBooking(Ticket GoingOut, ResponseDTO ResponseInfo, BookingDTO BookingInfo)
        {
            //Schedule
            string data = string.Format("__EVENTTARGET="+
"&__EVENTARGUMENT="+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&AvailabilitySearchInputScheduleSelectView$RadioButtonMarketStructure=OneWay"+
"&originStation1={0}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketOrigin1={0}"+
"&destinationStation1={1}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketDestination1={1}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDay1={2}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketMonth1={3}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDateRange1=0|4"+
"&date_picker={4}"+
"&originStation2="+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketOrigin2=Điểm đi..."+
"&destinationStation2="+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketDestination2=Điểm đến..."+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDay2={5}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketMonth2={6}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDateRange2=0|4"+
"&date_picker={7}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_ADT=1"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_CHD=0"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_INFANT=0"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListSearchBy=columnView"+
"&ControlGroupScheduleSelectView$AvailabilityInputScheduleSelectView$HiddenFieldTabIndex1=3"+
"&ControlGroupScheduleSelectView$AvailabilityInputScheduleSelectView$market1={8}"+
"&ControlGroupScheduleSelectView$AgreementInputScheduleSelectView$CheckBoxAgreement=on"+
"&ControlGroupScheduleSelectView$ButtonSubmit=Tiếp tục",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString(),//7
GoingOut.TicketID//8
);
                
            MeKongAirWebClient MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/ScheduleSelect.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            string text = MeKongClient.LoadPage(data);

            //contact
            data = string.Format("&__EVENTTARGET="+
"&__EVENTARGUMENT="+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&AvailabilitySearchInputContactView$RadioButtonMarketStructure=OneWay"+
"&originStation1={0}"+
"&AvailabilitySearchInputContactView$TextBoxMarketOrigin1={0}"+
"&destinationStation1={1}"+
"&AvailabilitySearchInputContactView$TextBoxMarketDestination1={1}"+
"&AvailabilitySearchInputContactView$DropDownListMarketDay1={2}"+
"&AvailabilitySearchInputContactView$DropDownListMarketMonth1={3}"+
"&AvailabilitySearchInputContactView$DropDownListMarketDateRange1=0|4"+
"&date_picker={4}"+
"&originStation2="+
"&AvailabilitySearchInputContactView$TextBoxMarketOrigin2=Điểm đi..."+
"&destinationStation2="+
"&AvailabilitySearchInputContactView$TextBoxMarketDestination2=Điểm đến..."+
"&AvailabilitySearchInputContactView$DropDownListMarketDay2={5}"+
"&AvailabilitySearchInputContactView$DropDownListMarketMonth2={6}"+
"&AvailabilitySearchInputContactView$DropDownListMarketDateRange2=0|4"+
"&date_picker={7}"+
"&AvailabilitySearchInputContactView$DropDownListPassengerType_ADT=1"+
"&AvailabilitySearchInputContactView$DropDownListPassengerType_CHD=0"+
"&AvailabilitySearchInputContactView$DropDownListPassengerType_INFANT=0"+
"&AvailabilitySearchInputContactView$DropDownListSearchBy=columnView"+
"&CONTROLGROUPCONTACT$ContactInputView$DropDownListTitle=MR"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxLastName={8}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxFirstName={9}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxAddressLine1={10}"+
"&CONTROLGROUPCONTACT$ContactInputView$DropDownListStateProvince=VN|SGN"+
"&CONTROLGROUPCONTACT$ContactInputView$DropDownListCountry=VN"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxHomePhone={11}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxEmailAddress={12}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxFax=283810410"+
"&CONTROLGROUPCONTACT$ContactInputView$CheckBoxPromoOpt=on"+
"&CONTROLGROUPCONTACT$ItineraryDistributionInputView$Distribution=2"+
"&CONTROLGROUPCONTACT$ButtonSubmit=Tiếp tục",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString(),
BookingInfo.LastName, //8
BookingInfo.FirstName,//9
BookingInfo.Address,//10
BookingInfo.PhoneNumber,//11
BookingInfo.Email //12
);

            MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/Contact.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            text = MeKongClient.LoadPage(data);

           

            //passenger
            data = string.Format("&__EVENTTARGET="+
"&__EVENTARGUMENT="+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&AvailabilitySearchInputPassengerView$RadioButtonMarketStructure=OneWay"+
"&originStation1={0}"+
"&AvailabilitySearchInputPassengerView$TextBoxMarketOrigin1={0}"+
"&destinationStation1={1}"+
"&AvailabilitySearchInputPassengerView$TextBoxMarketDestination1={1}"+
"&AvailabilitySearchInputPassengerView$DropDownListMarketDay1={2}"+
"&AvailabilitySearchInputPassengerView$DropDownListMarketMonth1={3}"+
"&AvailabilitySearchInputPassengerView$DropDownListMarketDateRange1=0|4"+
"&date_picker={4}"+
"&originStation2="+
"&AvailabilitySearchInputPassengerView$TextBoxMarketOrigin2=Điểm đi..."+
"&destinationStation2="+
"&AvailabilitySearchInputPassengerView$TextBoxMarketDestination2=Điểm đến..."+
"&AvailabilitySearchInputPassengerView$DropDownListMarketDay2={5}"+
"&AvailabilitySearchInputPassengerView$DropDownListMarketMonth2={6}"+
"&AvailabilitySearchInputPassengerView$DropDownListMarketDateRange2=0|4"+
"&date_picker={7}"+
"&AvailabilitySearchInputPassengerView$DropDownListPassengerType_ADT=1"+
"&AvailabilitySearchInputPassengerView$DropDownListPassengerType_CHD=0"+
"&AvailabilitySearchInputPassengerView$DropDownListPassengerType_INFANT=0"+
"&AvailabilitySearchInputPassengerView$DropDownListSearchBy=columnView"+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$DropDownListTitle_0=MR"+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$TextBoxLastName_0={8}"+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$TextBoxFirstName_0={9}"+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$TextBoxProgramNumber_0="+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$DropDownListProgram_0=UAT"+
"&CONTROLGROUPPASSENGER$ButtonSubmit=Tiếp tục",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString(),
BookingInfo.LastName, //8
BookingInfo.FirstName//9
            );

            MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/Passenger.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            text = MeKongClient.LoadPage(data);

            //payment1
            data = string.Format("&__EVENTTARGET=CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView"+
"&__EVENTARGUMENT=HOLD"+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&AvailabilitySearchInputPaymentView$RadioButtonMarketStructure=OneWay"+
"&originStation1={0}"+
"&AvailabilitySearchInputPaymentView$TextBoxMarketOrigin1={0}"+
"&destinationStation1={1}"+
"&AvailabilitySearchInputPaymentView$TextBoxMarketDestination1={1}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketDay1={2}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketMonth1={3}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketDateRange1=0|4"+
"&date_picker={4}"+
"&originStation2="+
"&AvailabilitySearchInputPaymentView$TextBoxMarketOrigin2=Điểm đi..."+
"&destinationStation2="+
"&AvailabilitySearchInputPaymentView$TextBoxMarketDestination2=Điểm đến..."+
"&AvailabilitySearchInputPaymentView$DropDownListMarketDay2={5}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketMonth2={6}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketDateRange2=0|4"+
"&date_picker={7}"+
"&AvailabilitySearchInputPaymentView$DropDownListPassengerType_ADT=1"+
"&AvailabilitySearchInputPaymentView$DropDownListPassengerType_CHD=0"+
"&AvailabilitySearchInputPaymentView$DropDownListPassengerType_INFANT=0"+
"&AvailabilitySearchInputPaymentView$DropDownListSearchBy=columnView"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$DropDownListPaymentMethodCode=ExternalAccount:AX"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$TextBoxAMT=1.302.500"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$TextBoxACCTNO="+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$DropDownListEXPDAT_Month=12"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$DropDownListEXPDAT_Year=2012"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$TextBoxCC__AccountHolderName=" +
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$TextBoxCC__VerificationCode=",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString()//7
);

            MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/Payment.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            text = MeKongClient.LoadPage(data);

            //payment2
            data = string.Format("__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8%3D&pageToken=&AvailabilitySearchInputPaymentView%24RadioButtonMarketStructure=RoundTrip&originStation1={0}&AvailabilitySearchInputPaymentView%24TextBoxMarketOrigin1={0}&destinationStation1={1}&AvailabilitySearchInputPaymentView%24TextBoxMarketDestination1={1}&AvailabilitySearchInputPaymentView%24DropDownListMarketDay1={2}&AvailabilitySearchInputPaymentView%24DropDownListMarketMonth1={3}&AvailabilitySearchInputPaymentView%24DropDownListMarketDateRange1=0%7C4&date_picker={4}&originStation2={1}&AvailabilitySearchInputPaymentView%24TextBoxMarketOrigin2={1}&destinationStation2={0}&AvailabilitySearchInputPaymentView%24TextBoxMarketDestination2={0}&AvailabilitySearchInputPaymentView%24DropDownListMarketDay2={5}&AvailabilitySearchInputPaymentView%24DropDownListMarketMonth2={6}&AvailabilitySearchInputPaymentView%24DropDownListMarketDateRange2=0%7C4&date_picker={7}&AvailabilitySearchInputPaymentView%24DropDownListPassengerType_ADT=1&AvailabilitySearchInputPaymentView%24DropDownListPassengerType_CHD=0&AvailabilitySearchInputPaymentView%24DropDownListPassengerType_INFANT=0&AvailabilitySearchInputPaymentView%24DropDownListSearchBy=columnView&DropdowDS=ABO&CONTROLGROUPPAYMENTBOTTOM%24ButtonSubmit=Thanh+to%C3%A1n",
                ResponseInfo.Origin,//0
                ResponseInfo.Destination,//1
                ResponseInfo.StartDate.Day.ToString(),//2
                ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
                ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
                ResponseInfo.EndDate.Day.ToString(),//5
                ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
                ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString()
            );

            MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/Payment.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            text = MeKongClient.LoadPage(data);

            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(text);


        }

        public static void RoundTripBooking(Ticket GoingOut, Ticket ComingBack, ResponseDTO ResponseInfo, BookingDTO BookingInfo)
        {
            
            string data = string.Format("&__EVENTTARGET="+
"&__EVENTARGUMENT="+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&AvailabilitySearchInputScheduleSelectView$RadioButtonMarketStructure=RoundTrip" +
"&originStation1={0}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketOrigin1={0}"+
"&destinationStation1={1}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketDestination1={1}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDay1={2}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketMonth1={3}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDateRange1=0|4"+
"&date_picker={4}"+
"&originStation2={1}" +
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketOrigin2={1}" +
"&destinationStation2={0}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketDestination2={0}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDay2={5}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketMonth2={6}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDateRange2=0|4"+
"&date_picker={7}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_ADT=1"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_CHD=0"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_INFANT=0"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListSearchBy=columnView"+
"&ControlGroupScheduleSelectView$AvailabilityInputScheduleSelectView$HiddenFieldTabIndex1=3"+
"&ControlGroupScheduleSelectView$AvailabilityInputScheduleSelectView$market1={8}" +
"&ControlGroupScheduleSelectView$AvailabilityInputScheduleSelectView$HiddenFieldTabIndex2=3"+
"&ControlGroupScheduleSelectView$AvailabilityInputScheduleSelectView$market2={9}" +
"&ControlGroupScheduleSelectView$AgreementInputScheduleSelectView$CheckBoxAgreement=on" +
"&ControlGroupScheduleSelectView$ButtonSubmit=Tiếp tục",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString(),//7
GoingOut.TicketID,//8
ComingBack.TicketID);//9


            MeKongAirWebClient MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/ScheduleSelect.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            string text = MeKongClient.LoadPage(data);

            data = string.Format("&__EVENTTARGET="+
"&__EVENTARGUMENT="+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&AvailabilitySearchInputScheduleSelectView$RadioButtonMarketStructure=RoundTrip" +
"&originStation1={0}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketOrigin1={0}"+
"&destinationStation1={1}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketDestination1={1}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDay1={2}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketMonth1={3}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDateRange1=0|4"+
"&date_picker={4}"+
"&originStation2={1}" +
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketOrigin2={1}" +
"&destinationStation2={0}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketDestination2={0}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDay2={5}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketMonth2={6}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDateRange2=0|4"+
"&date_picker={7}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_ADT=1"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_CHD=0"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_INFANT=0"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListSearchBy=columnView"+
"&CONTROLGROUPCONTACT$ContactInputView$DropDownListTitle={8}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxLastName={9}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxFirstName={10}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxAddressLine1={11}"+
"&CONTROLGROUPCONTACT$ContactInputView$DropDownListStateProvince=VN|SGN"+
"&CONTROLGROUPCONTACT$ContactInputView$DropDownListCountry=VN"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxHomePhone={12}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxEmailAddress={13}"+
"&CONTROLGROUPCONTACT$ContactInputView$TextBoxFax=2994598"+
"&CONTROLGROUPCONTACT$ContactInputView$CheckBoxPromoOpt=on"+
"&CONTROLGROUPCONTACT$ItineraryDistributionInputView$Distribution=0"+
"&CONTROLGROUPCONTACT$ButtonSubmit=Tiếp tục",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString(),//7
BookingInfo.Title,//8
BookingInfo.LastName,//9
BookingInfo.FirstName,//10
BookingInfo.Address,//11
BookingInfo.PhoneNumber,//12
BookingInfo.Email//13
);

            MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/Contact.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            text = MeKongClient.LoadPage(data);

            //Data
            data = string.Format("&__EVENTTARGET="+
"&__EVENTARGUMENT="+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&AvailabilitySearchInputScheduleSelectView$RadioButtonMarketStructure=RoundTrip" +
"&originStation1={0}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketOrigin1={0}"+
"&destinationStation1={1}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketDestination1={1}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDay1={2}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketMonth1={3}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDateRange1=0|4"+
"&date_picker={4}"+
"&originStation2={1}" +
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketOrigin2={1}" +
"&destinationStation2={0}"+
"&AvailabilitySearchInputScheduleSelectView$TextBoxMarketDestination2={0}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDay2={5}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketMonth2={6}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListMarketDateRange2=0|4"+
"&date_picker={7}"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_ADT=1"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_CHD=0"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListPassengerType_INFANT=0"+
"&AvailabilitySearchInputScheduleSelectView$DropDownListSearchBy=columnView"+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$DropDownListTitle_0={8}"+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$TextBoxLastName_0={9}"+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$TextBoxFirstName_0={10}"+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$TextBoxProgramNumber_0="+
"&CONTROLGROUPPASSENGER$PassengerInputViewPassengerView$DropDownListProgram_0=UAT"+
"&CONTROLGROUPPASSENGER$ButtonSubmit=Tiếp tục",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString(),//7
BookingInfo.Title,//8
BookingInfo.LastName,//9
BookingInfo.FirstName//10
);

            MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/Passenger.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            text = MeKongClient.LoadPage(data);


            //Data
            data = string.Format("&__EVENTTARGET=CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView"+
"&__EVENTARGUMENT=HOLD"+
"&__VIEWSTATE=/wEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8="+
"&pageToken="+
"&AvailabilitySearchInputPaymentView$RadioButtonMarketStructure=RoundTrip"+
"&originStation1={0}"+
"&AvailabilitySearchInputPaymentView$TextBoxMarketOrigin1={0}" +
"&destinationStation1={1}"+
"&AvailabilitySearchInputPaymentView$TextBoxMarketDestination1={1}" +
"&AvailabilitySearchInputPaymentView$DropDownListMarketDay1={2}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketMonth1={3}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketDateRange1:0|4"+
"&date_picker={4}"+
"&originStation2={1}"+
"&AvailabilitySearchInputPaymentView$TextBoxMarketOrigin2={1}" +
"&destinationStation2={0}" +
"&AvailabilitySearchInputPaymentView$TextBoxMarketDestination2={0}" +
"&AvailabilitySearchInputPaymentView$DropDownListMarketDay2={5}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketMonth2={6}"+
"&AvailabilitySearchInputPaymentView$DropDownListMarketDateRange2=0|4"+
"&date_picker={7}"+
"&AvailabilitySearchInputPaymentView$DropDownListPassengerType_ADT=1"+
"&AvailabilitySearchInputPaymentView$DropDownListPassengerType_CHD=0"+
"&AvailabilitySearchInputPaymentView$DropDownListPassengerType_INFANT=0"+
"&AvailabilitySearchInputPaymentView$DropDownListSearchBy=columnView"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$DropDownListPaymentMethodCode=ExternalAccount:AX"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$TextBoxAMT=3.778.000" +
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$TextBoxACCTNO="+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$DropDownListEXPDAT_Month=12"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$DropDownListEXPDAT_Year=2012"+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$TextBoxCC__AccountHolderName="+
"&CONTROLGROUPPAYMENTBOTTOM$PaymentInputViewPaymentView$TextBoxCC__VerificationCode=",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString()//7
);

            MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/Payment.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            text = MeKongClient.LoadPage(data);

            //Data

            data = string.Format("__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUBMGRk77h9CNekodLMZhdJu3riPx9ebN8%3D&pageToken=&AvailabilitySearchInputPaymentView%24RadioButtonMarketStructure=RoundTrip&originStation1={0}&AvailabilitySearchInputPaymentView%24TextBoxMarketOrigin1={0}&destinationStation1={1}&AvailabilitySearchInputPaymentView%24TextBoxMarketDestination1={1}&AvailabilitySearchInputPaymentView%24DropDownListMarketDay1={2}&AvailabilitySearchInputPaymentView%24DropDownListMarketMonth1={3}&AvailabilitySearchInputPaymentView%24DropDownListMarketDateRange1=0%7C4&date_picker={4}&originStation2={1}&AvailabilitySearchInputPaymentView%24TextBoxMarketOrigin2={1}&destinationStation2={0}&AvailabilitySearchInputPaymentView%24TextBoxMarketDestination2={0}&AvailabilitySearchInputPaymentView%24DropDownListMarketDay2={5}&AvailabilitySearchInputPaymentView%24DropDownListMarketMonth2={6}&AvailabilitySearchInputPaymentView%24DropDownListMarketDateRange2=0%7C4&date_picker={7}&AvailabilitySearchInputPaymentView%24DropDownListPassengerType_ADT=1&AvailabilitySearchInputPaymentView%24DropDownListPassengerType_CHD=0&AvailabilitySearchInputPaymentView%24DropDownListPassengerType_INFANT=0&AvailabilitySearchInputPaymentView%24DropDownListSearchBy=columnView&DropdowDS=ABO&CONTROLGROUPPAYMENTBOTTOM%24ButtonSubmit=Thanh+to%C3%A1n",
ResponseInfo.Origin,//0
ResponseInfo.Destination,//1
ResponseInfo.StartDate.Day.ToString(),//2
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString(),//3
ResponseInfo.StartDate.Year.ToString() + "-" + ResponseInfo.StartDate.Month.ToString() + "-" + ResponseInfo.StartDate.Day.ToString(),//4
ResponseInfo.EndDate.Day.ToString(),//5
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString(),//6
ResponseInfo.EndDate.Year.ToString() + "-" + ResponseInfo.EndDate.Month.ToString() + "-" + ResponseInfo.EndDate.Day.ToString()//7);
);

            MeKongClient = MeKongAirWebClient.GetMeKongAirWebClient("https://booking.airmekong.com.vn/Payment.aspx");
            MeKongClient.Headers["Cookie"] = "ASP.NET_SessionId=4hyuap55e2nhci55ghlp1luj; __utma=187758136.1394256083.1356285971.1356285971.1356285971.1; __utmb=187758136.2.10.1356285971; __utmc=187758136; __utmz=187758136.1356285971.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=mekongair";
            text = MeKongClient.LoadPage(data);

            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(text);
        }
    }

    
}
